<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function test1() {
            var n = 100;
            function add() {
                n++
                console.log(n)
            }
            function reduce() {
                n--
                console.log(n)
            }
            console.log("还是你" + n)
            return [add, reduce]
        }
        var arr = test1();
        arr[0]();
        arr[1]();
        arr[1]();
        arr[1]();
        arr[1]();
        test1()
    </script>
</body>

</html>